//后序遍历的递归实现

class Solution
{
public:
    vector<int> res;
    vector<int> postorderTraversal(TreeNode *root)
    {
        postOrder(root);
        return res;
    }
    void postOrder(TreeNode *root)
    {
        if (root != NULL)
        {
            postOrder(root->left);
            postOrder(root->right);
            res.push_back(root->val);
        }
    }
};